package cn.yj.cgs.dba.entity;

import cn.yj.cgs.dba.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;

/**
 * @author 永健
 * @since 2021-06-16 11:28
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "tb_message")
public class Message extends BaseEntity {

    @NotBlank(message = "请输入内容")
    private String content;

    @NotBlank(message = "请输入标题")
    private String title;

    private String userCode;

    private Boolean all;

    @TableField(exist = false)
    private Boolean read;

    @TableField(exist = false)
    private String realName;

    private String messageType;

    @TableLogic
    private Boolean deleted;

    public Message() {
    }

    public Message(String content, String title, String userCode) {
        this.content = content;
        this.title = title;
        this.userCode = userCode;
    }
}
